@import 'scss-imports/cssvars';

.search-box-wrapper {
  margin-left: 307px;
  margin-top: 7.5px;
  position: absolute;

  &.sidenav-collapsed {
    margin-left: 115px;
  }

  &.sidenav-mobile {
    margin-left: 67px;

    @media(max-width: $breakpoint-xs) {
      margin-left: 10px;
      margin-top: 4px;
      width: 100vw;

      .search-box {
        width: 95%;
      }
    }
  }
}

.search-box {
  background: var(--bg1);
  border: solid 1px var(--lines);
  border-radius: 2px;
  display: flex;
  flex-direction: row;
  font-size: 12px;
  position: relative;
  width: 450px;

  @media(max-width: $breakpoint-md) {
    width: 250px;
  }

  &:focus-within {
    border-color: var(--primary);
  }

  &:focus-within {
    .search-input {
      opacity: 1;
    }

    .search-icon {
      opacity: 1;
    }
  }

  .search-icon {
    color: var(--fg1);
    left: 4px;
    opacity: 0.2;
    position: absolute;
    top: 3px;
  }

  .search-input {
    opacity: 0.7;
    padding-right: 30px;
  }

  ::ng-deep input {
    padding-left: 30px;
  }

  .reset-input {
    align-items: center;
    bottom: 0;
    color: var(--fg1);
    cursor: pointer;
    display: flex;
    line-height: initial;
    opacity: 0.5;
    padding: 5px;
    position: absolute;
    right: 0.3rem;
    top: 0;
    user-select: none;

    ix-icon {
      height: 17px;
      width: 17px;

      &:focus-visible {
        border-radius: 50%;
        outline: 1px solid var(--primary);
      }
    }
  }
}
